<?php
require("../../../class/connect.php");
include("../../../class/config.php");
include("../../../class/q_functions.php");
include("../../../class/db_sql.php");
include("../../../class/user.php");
$link=db_connect();
$empire=new mysqlquery();
$editor=2;
$user=islogin();
$mid=(int)$_GET['mid'];
$out=$_GET['out'];
if(empty($mid))
{
	printerror("HaveNotMsg","",1);
}
$r=$empire->fetch1("select mid,title,msgtext,from_userid,from_username,msgtime,haveread,issys from {$dbtbpre}enewsqmsg where mid=$mid and to_username='$user[username]' limit 1");
if(empty($r[mid]))
{
	printerror("HaveNotMsg","",1);
}
if($r['issys'])
{
	$r[from_username]="<b>系统信息</b>";
}
if(!$r['haveread'])
{
	$usql=$empire->query("update {$user_tablename} set ".$user_havemsg."=0 where ".$user_userid."='$user[userid]'");
	$usql=$empire->query("update {$dbtbpre}enewsqmsg set haveread=1 where mid=$mid");
}
db_close();
$empire=null;
$url="<a href=../../../../>首页</a>&nbsp;>&nbsp;<a href=../../cp>控制面板</a>&nbsp;>&nbsp;<a href=../../msg?out=".$out.">收件箱</a>&nbsp;>&nbsp;查看短信息";
@include("../../../data/template/cp_1.php");
?> 
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr> 
    <td width="15%" valign="top"> <table width="100%" border="0" cellpadding="3" cellspacing="1" class="tableborder">
        <tr class="header"> 
          <td height="23">短信息管理</td>
        </tr>
        <tr> 
          <td height="23" bgcolor="#FFFFFF"><img src="../../../data/images/msgnav.gif" width="5" height="5">&nbsp;<a href="../../msg">收件箱</a></td>
        </tr>
        <tr> 
          <td height="23" bgcolor="#FFFFFF"><img src="../../../data/images/msgnav.gif" width="5" height="5">&nbsp;<a href="../../msg?out=1">发件箱</a></td>
        </tr>
        <tr> 
          <td height="23" bgcolor="#FFFFFF"><img src="../../../data/images/msgnav.gif" width="5" height="5">&nbsp;<a href="../AddMsg?enews=AddMsg">发送信息</a></td>
        </tr>
      </table></td>
    <td width="1%" valign="top">&nbsp;</td>
    <td width="84%" valign="top"> <div align="center">
        <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
          <form name="form1" method="post" action="../../../enews/index.php">
            <tr class="header"> 
              <td height="23" colspan="2">
                <?=stripSlashes($r[title])?>
              </td>
            </tr>
            <tr bgcolor="#FFFFFF"> 
              <td width="19%" height="25">发送者：</td>
              <td width="81%" height="25"><a href="../../ShowInfo?userid=<?=$r[from_userid]?>"> 
                <?=$r[from_username]?>
                </a></td>
            </tr>
            <tr bgcolor="#FFFFFF"> 
              <td height="25">发送时间：</td>
              <td height="25">
                <?=$r[msgtime]?>
              </td>
            </tr>
            <tr bgcolor="#FFFFFF"> 
              <td height="25" valign="top">内容：</td>
              <td height="25"> 
                <?=nl2br(stripSlashes($r[msgtext]))?>
              </td>
            </tr>
            <tr bgcolor="#FFFFFF"> 
              <td height="25" valign="top">&nbsp;</td>
              <td height="25">[<a href="#ecms" onclick="javascript:history.go(-1);"><strong>返回</strong></a>] 
                [<a href="../AddMsg?enews=AddMsg&re=1&mid=<?=$mid?>&out=<?=$out?>"><strong>回复</strong></a>] 
                [<a href="../AddMsg?enews=AddMsg&mid=<?=$mid?>&out=<?=$out?>"><strong>转发</strong></a>] 
                [<a href="../../../enews?enews=DelMsg&mid=<?=$mid?>&out=<?=$out?>" onclick="return confirm('确认要删除?');"><strong>删除</strong></a>]</td>
            </tr>
          </form>
        </table>
      </div></td>
  </tr>
</table>
<?
@include("../../../data/template/cp_2.php");
db_close();
$empire=null;
?>